#ifndef SOUND_2D_H
#define SOUND_2D_H

#include "Asset.h"
#include "irrKlang.h"
#include <memory>

namespace Engine
{
	class Sound2D : public Asset
	{
		protected:
			irrklang::ISound* m_sound;

		public:
			Sound2D():m_sound(nullptr){}
			virtual bool Load(const std::string& fileName);
			virtual bool Load(rapidxml::xml_node <>* node);
			void Play();
			void Pause();
			void Stop();
			bool IsPlaying();

			//getters & setters
			void SetLoop(bool l);
			//! sets volume between 0 (mute) and 1 (full volume)
			void SetVolume(float v);
			void SetTrackPos(float p);
			irrklang::ISoundEffectControl* GetController();

			float GetVolume() const;
			float GetTrackPos() const;
			float GetLength() const;

			virtual ~Sound2D();
	};
	typedef std::shared_ptr <Sound2D> Sound2DSPtr;
}

#endif